/*
 * @Copyright: (C) 2019 Zhang Rida. All rights reserved.
 *
 * @Author: Zhang Rida
 * @Email: 215154317@qq.com
 * @FilePath: /WEILA_SDK_MODULE/src/wlsdk/src/burst_module.h
 * @Date: 2021-02-27 17:08:35
 * @Description:
 *
 * @LastEditors: Zhang Rida
 * @LastEditTime: 2024-09-11 18:38:48
 */
#ifndef _BURST_MODULE_H
#define _BURST_MODULE_H

#include "wlsdk_define.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef enum {
    BURST_MSG_REQUEST                  = 0,
    BURST_MSG_RELEASE                  = 1,
    BURST_MSG_PLAYBACK                 = 2,
    BURST_MSG_TTS                      = 3,
    BURST_MSG_REALTIME_AUDIO           = 4,
    BURST_MSG_PLAY_RESULT              = 5,
    BURST_MSG_PLAY_END                 = 6,
    BURST_MSG_RECORD_DATA              = 7,
    BURST_MSG_RECORD_END               = 8,
    BURST_MSG_SET_BURST_SESSION        = 9,
    BURST_MSG_REMOVE_SESSION           = 10,
    BURST_MSG_CLOSE_SESSION            = 11,
    BURST_MSG_CHECK                    = 12,
    BURST_MSG_PAUSE                    = 13,
    BURST_MSG_RESUME                   = 14,
    BURST_MSG_VOIP_INVITE              = 15,
    BURST_MSG_VOIP_ACCEPT              = 16,
    BURST_MSG_VOIP_HANGUP              = 17,
    BURST_MSG_VOIP_PLAY_RESULT         = 18,
    BURST_MSG_VOIP_PLAY_END            = 19,
    BURST_MSG_VOIP_RECORD_DATA         = 20,
    BURST_MSG_VOIP_RECORD_END          = 21,
    BURST_MSG_BUTTON_PRESS             = 22,
    BURST_MSG_BUTTON_RELEASE           = 23,
    BURST_MSG_SET_VOIP_AUTO_ACCEPT     = 24,
    BURST_MSG_CHECK_SESSION            = 25,
    BURST_MSG_CLEAR_ACCOUNT            = 26,
    BURST_MSG_RECORD_DROP_DURATION     = 27,
    BURST_MSG_RECORD_END_DROP_DURATION = 28,
    BURST_MSG_BURST_SWITCH             = 29,
} burst_module_msgid;

typedef enum {
    //请求类型
    BURST_CTRL_REQUEST = 0x00,  //请求话权
    BURST_CTRL_RELEASE = 0x01,  //释放话权

    //通知类型
    BURST_CTRL_INTERRUPT = 0x08,  //打断讲话(终端收到后停止播放被打断用户语音)
    BURST_CTRL_REVOKE    = 0x09,  //话权回收
    BURST_CTRL_TAKEN     = 0x0a,  //话权占用
    BURST_CTRL_IDLE      = 0x0b   //话权空闲
} burst_ctrltype;

typedef struct __burst_realtime_audio {
    wl_uint32 rate;  // 8000 16000
    wl_uint32 datalen;
    wl_bool iscompress;
    wl_char   data[ZERO_CONTENT_SIZE];
} burst_realtime_audio;

typedef struct __burst_sessioninfo {
    wl_uint64 sessionid;    //会话id
    wl_uint16 sessiontype;  //会话类型
} burst_sessioninfo;

typedef struct __login_voip_auto_accept {
    wl_bool   auto_accept;
    wl_uint32 delay_ms;
} burst_voip_auto_accept;

wl_int32 burst_module_init(wlsdk_message_callback callback);
wl_int32 burst_module_burst_release_audio_drop(void);
wl_int32 burst_module_end(void);

#ifdef __cplusplus
}
#endif
#endif
